<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>userquestion</title>
		<link rel="stylesheet" href="../../resources/layui/css/layui.css" />
		<link rel="stylesheet" href="../../resources/css/u_queston.css" />
		<script type="text/javascript" src="../../resources/js/jquery-1.11.1.min.js" ></script>
	</head>

	<body>
		<div class="content">
			<ul class="layui-timeline" id="question">
				<!--<li class="layui-timeline-item">
					<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
					<div class="layui-timeline-content layui-text">
						<h3 class="layui-timeline-title">8月18日</h3>

						<div class="q_content">
							<div class="l_img">
								<a href="usercourses.jsp" target="_blank">
									<img width="40" height="40" alt="" src="../../resources/images/course/course1.png" />
								</a>
							</div>
							<div class="r_details">
								<div class="question_type">
									所属分类：
									<a>测试</a>
								</div>
								<div class="question_title">
									<a class="q_title" href="" target="_blank">测试测试测试测试测试测试测试测试测试</a>
								</div>
								<div class="question_time">
									<i class="layui-icon layui-icon-date"><span class="q_date">2018-6-17  00-00-00</span></i>
									<i class="layui-icon layui-icon-dialogue"><span class="q_nummber">12人</span></i>
								</div>
							</div>
						</div>

					</div>
				</li>
				<li class="layui-timeline-item">
					<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
					<div class="layui-timeline-content layui-text">
						<h3 class="layui-timeline-title">8月16日</h3>
						<div class="q_content">
							<div class="l_img">
								<a href="usercourses.jsp" target="_blank">
									<img width="40" height="40" alt="" src="../../resources/images/course/course1.png" />
								</a>
							</div>
							<div class="r_details">
								<div class="question_type">
									所属分类：
									<a>测试</a>
								</div>
								<div class="question_title">
									<a class="q_title" href="" target="_blank">测试测试测试测试测试测试测试测试测试</a>
								</div>
								<div class="question_time">
									<i class="layui-icon layui-icon-date"><span class="q_date">2018-6-17  00-00-00</span></i>
									<i class="layui-icon layui-icon-dialogue"><span class="q_nummber">12人</span></i>
								</div>
							</div>
						</div>

					</div>
				</li>
				<li class="layui-timeline-item">
					<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
					<div class="layui-timeline-content layui-text">
						<h3 class="layui-timeline-title">8月15日</h3>
						<div class="q_content">
							<div class="l_img">
								<a href="usercourses.jsp" target="_blank">
									<img width="40" height="40" alt="" src="../../resources/images/course/course1.png" />
								</a>
							</div>
							<div class="r_details">
								<div class="question_type">
									所属分类：
									<a>测试</a>
								</div>
								<div class="question_title">
									<a class="q_title" href="" target="_blank">测试测试测试测试测试测试测试测试测试</a>
								</div>
								<div class="question_time">
									<i class="layui-icon layui-icon-date"><span class="q_date">2018-6-17  00-00-00</span></i>
									<i class="layui-icon layui-icon-dialogue"><span class="q_nummber">12人</span></i>
								</div>
							</div>
						</div>

					</div>
				</li>-->
				<!--<li class="layui-timeline-item">
					<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
					<div class="layui-timeline-content layui-text">
						<div class="layui-timeline-title">过去</div>

					</div>
				</li>-->
			</ul>
		</div>

	</body>

	<script>
		$(document).ready(function(){
			var userid = ${sessionScope.userId};
		$.ajax({
			type:"post",
			url:"/article/queryAllQuestionById.action",
			data:{
				"users.userId":userid
			},
			dataType:'Json',
			success:function(data){
				$.each(data.article,function(index,item){
					
					var releaseTime = new Date(item.releaseTime);
					var year=releaseTime.getFullYear();
					var day=releaseTime.getDate();
					var month=+releaseTime.getMonth()+1;
					var time = month+"月"+day+"日";
			
					var lastUpdateTime = new Date(item.lastUpdateTime);
					var year1=lastUpdateTime.getFullYear();
					var day1=lastUpdateTime.getDate();
					var month1=+lastUpdateTime.getMonth()+1;
					var hour1=lastUpdateTime.getHours();
					var minute1=lastUpdateTime.getMinutes();
					
					var a = "<li class='layui-timeline-item'><i class='layui-icon layui-timeline-axis'>&#xe63f;</i>";
					a += "<div class='layui-timeline-content layui-text'><h3 class='layui-timeline-title'>"+time+"</h3>";
					a += "<div class='q_content'><div class='l_img'><a href='usercourses.jsp' target='_blank'><img width='40' height='40' alt='' src="+item.articleImage+" /></a></div>";
					a += "<div class='r_details'><div class='question_type'>所属分类：<a>测试</a></div>";
					a += "<div class='question_title'><a class='q_title' href='/pages/question/questiondetails.jsp?questionid="+item.articleId+"' target='_blank'>"+item.articleTitle+"</a></div><div class='question_time'>";
					a += "<i class='layui-icon layui-icon-date'><span class='q_date'>"+item.releaseTime+"</span></i><i class='layui-icon layui-icon-dialogue'><span class='q_nummber'>12人</span></i></div></div></div></div></li>";
					$("#question").append(a);
				});
			}
		});
		});
		
		
		
	</script>
	
</html>